package com.ruoyi.goods.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.goods.mapper.WGoodsExtAssistMapper;
import com.ruoyi.goods.domain.WGoodsExtAssist;
import com.ruoyi.goods.service.IWGoodsExtAssistService;

/**
 * 建扩辅助Service业务层处理
 * 
 * @author ruoyi
 * @date 2024-05-27 21:48:33
 */
@Service
public class WGoodsExtAssistServiceImpl implements IWGoodsExtAssistService 
{
    @Autowired
    private WGoodsExtAssistMapper wGoodsExtAssistMapper;

    /**
     * 查询建扩辅助
     * 
     * @param goodsExtAssistId 建扩辅助主键
     * @return 建扩辅助
     */
    @Override
    public WGoodsExtAssist selectWGoodsExtAssistByGoodsExtAssistId(Long goodsExtAssistId)
    {
        return wGoodsExtAssistMapper.selectWGoodsExtAssistByGoodsExtAssistId(goodsExtAssistId);
    }

    /**
     * 查询建扩辅助列表
     * 
     * @param wGoodsExtAssist 建扩辅助
     * @return 建扩辅助
     */
    @Override
    public List<WGoodsExtAssist> selectWGoodsExtAssistList(WGoodsExtAssist wGoodsExtAssist)
    {
        return wGoodsExtAssistMapper.selectWGoodsExtAssistList(wGoodsExtAssist);
    }

    /**
     * 新增建扩辅助
     * 
     * @param wGoodsExtAssist 建扩辅助
     * @return 结果
     */
    @Override
    public int insertWGoodsExtAssist(WGoodsExtAssist wGoodsExtAssist)
    {
        wGoodsExtAssist.setCreateTime(DateUtils.getNowDate());
        return wGoodsExtAssistMapper.insertWGoodsExtAssist(wGoodsExtAssist);
    }

    /**
     * 修改建扩辅助
     * 
     * @param wGoodsExtAssist 建扩辅助
     * @return 结果
     */
    @Override
    public int updateWGoodsExtAssist(WGoodsExtAssist wGoodsExtAssist)
    {
        wGoodsExtAssist.setUpdateTime(DateUtils.getNowDate());
        return wGoodsExtAssistMapper.updateWGoodsExtAssist(wGoodsExtAssist);
    }

    /**
     * 批量删除建扩辅助
     * 
     * @param goodsExtAssistIds 需要删除的建扩辅助主键
     * @return 结果
     */
    @Override
    public int deleteWGoodsExtAssistByGoodsExtAssistIds(Long[] goodsExtAssistIds)
    {
        return wGoodsExtAssistMapper.deleteWGoodsExtAssistByGoodsExtAssistIds(goodsExtAssistIds);
    }

    /**
     * 删除建扩辅助信息
     * 
     * @param goodsExtAssistId 建扩辅助主键
     * @return 结果
     */
    @Override
    public int deleteWGoodsExtAssistByGoodsExtAssistId(Long goodsExtAssistId)
    {
        return wGoodsExtAssistMapper.deleteWGoodsExtAssistByGoodsExtAssistId(goodsExtAssistId);
    }

    /**
     * 删除建扩辅助信息
     *
     * @param enterWarehouseNumber 建扩辅助主键
     * @return 结果
     */
    @Override
    public int deleteWGoodsExtAssistByEnterWarehouseNumber(String enterWarehouseNumber)
    {
        return wGoodsExtAssistMapper.deleteWGoodsExtAssistByEnterWarehouseNumber(enterWarehouseNumber);
    }

    /**
     * 查询建扩辅助，按时间顺序，取最早的一次入库
     *
     * @param bundleNumber goods_ext捆包号
     * @param inventoryStatus 库存状态
     * @return 建扩辅助
     */
    @Override
    public WGoodsExtAssist selectWGoodsExtAssistOneByEnterWarehouseTimeAsc(String bundleNumber, String inventoryStatus)
    {
        return wGoodsExtAssistMapper.selectWGoodsExtAssistOneByEnterWarehouseTimeAsc(bundleNumber, inventoryStatus);
    }

    /**
     * 查询建扩辅助列表
     *
     * @param exitWarehouseNumber 出库编号
     * @param inventoryStatus 库存状态
     * @return 建扩辅助集合
     */
    @Override
    public List<WGoodsExtAssist> selectWGoodsExtAssistListByExitWarehouseNumber(String exitWarehouseNumber, String inventoryStatus)
    {
        return wGoodsExtAssistMapper.selectWGoodsExtAssistListByExitWarehouseNumber(exitWarehouseNumber, inventoryStatus);
    }

    /**
     * 修改建扩辅助
     *
     * @param wGoodsExtAssist 建扩辅助
     * @return 结果
     */
    @Override
    public int updateWGoodsExtAssistExitWarehouseRelFields(WGoodsExtAssist wGoodsExtAssist)
    {
        return wGoodsExtAssistMapper.updateWGoodsExtAssistExitWarehouseRelFields(wGoodsExtAssist);
    }

    /**
     * 查询建扩辅助列表
     *
     * @param goodsTransferNumber 货转编号
     * @param inventoryStatus 库存状态
     * @return 建扩辅助集合
     */
    @Override
    public List<WGoodsExtAssist> selectWGoodsExtAssistListByGoodsTranserNumber(String goodsTransferNumber, String inventoryStatus)
    {
        return wGoodsExtAssistMapper.selectWGoodsExtAssistListByGoodsTranserNumber(goodsTransferNumber, inventoryStatus);
    }

    /**
     * 修改建扩辅助
     *
     * @param wGoodsExtAssist 建扩辅助
     * @return 结果
     */
    @Override
    public int updateWGoodsExtAssistGoodsTransferRelFields(WGoodsExtAssist wGoodsExtAssist)
    {
        return wGoodsExtAssistMapper.updateWGoodsExtAssistGoodsTransferRelFields(wGoodsExtAssist);
    }

}
